Important Scenarios

Introduction

We present three scenarios by giving presenting a context, a stimulus and Gradle's expected behavior. Readers will be convinced after reading our AD that Gradle exhibits the correct system response in these three scenarios. We will reference these scenarios throughout our AD.

Scenario 1

Unproblematic Gradle build

Overview

A member of a software development team wants to build the software following a series of changes to the source code, the changes to the source code do not require Gradle to be reconfigured.

System state

Gradle is already configured to be build the software via the settings script file and project script files.

System environment

A Gradle daemon is available to run the build.

External stimulus

The developer runs a Gradle build task via the command line interface. (gradle build).

Required system response

Gradle does not use the build cache, it recompiles all the software's source code dictated by Gradle's configuration. It uses the existing Gradle daemon to run the build, thus improving performance.


Scenario 2

Applying Plugins to increase Gradle's Functionality

Overview

A developer modified Gradle's configuration such that it applies a plugin on a particular project.

System state

The plugin is not present locally and must be downloaded/fetched. The project's configuration script file is configured to include the plugin and includes the plugin's source repository.

System environment

The source repository is available (e.g. if the source repository is a website, then the website is not down).

External stimulus

The developer runs a build task which is configured to build the aforementioned project.

Required system response

Gradle fetches the plugin from the source and applies to the project during the build's configuration phase.


Scenario 3

Compile only the source code that changed (Incremental Build)

Overview

A developer runs a build on a project. Gradle does not need to recompile every single source file, if a source file was not changed, Gradle does not need to recompile it.

System state

The project was previously built, and the source code files did not change.

System environment

N/A

Environment changes

The developer runs a build which includes the compilation of the aforementioned project.

Required system behavior

Gradle only runs the compilation related tasks whose input did not change, therefore if a compilation task takes source code as input, then the source code will be recompiled if and only if it did not change.